package com.vue.entity.es;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDate;

/**
 * @author: wrj
 * @since: 2023/6/8 17:50
 * @description:
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(indexName = "idx_user")
public class EsUserEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 企业审核记录表id
     */
    @Id
    private Long id;

    /**
     * 用户名
     */
    @Field(name="name",type = FieldType.Text)
    private String name;

    /**
     * 姓名
     */
    @Field(name="real_name", searchAnalyzer = "ik_smart", analyzer = "ik_max_word",type = FieldType.Text)
    private String realName;

    /**
     * 密码
     */
    @Field(name="password",type = FieldType.Text)
    private String password;

    /**
     * openId
     */
    @Field(name="open_id",type = FieldType.Text)
    private String openId;

    /**
     * 手机号
     */
    @Field(name="phone",type = FieldType.Text)
    private String phone;

    /**
     * 年龄
     */
    @Field(name="age",type = FieldType.Integer)
    private Integer age;

    /**
     * 生日
     */
    @Field(name="birthday",type = FieldType.Text)
    private String birthday;
    /**
     * 性别（1男，0女）
     */
    @Field(name="sex",type = FieldType.Integer)
    private Integer sex;

    /**
     * 邮箱
     */
    @Field(name="email",type = FieldType.Text)
    private String email;

    @Field(name="createUser",type = FieldType.Text)
    private String createUser;

    @Field(name="create_time", format = DateFormat.date)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate createTime;

}


